package biz.ezcom.design.pattern.decorator;

/**
 * 组件的装饰器抽象
 */
public abstract class ComponentDecorator implements Component{
	private Component component;
	
	public ComponentDecorator() {
	}

	public ComponentDecorator(Component component) {
		this.component = component;
	}
	public Component getComponent() {
		return component;
	}

	public void setComponent(Component component) {
		this.component = component;
	}

	@Override
	public void operation(){
		if(this.component != null){
			this.component.operation();
		}
	}
}
